/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package backupBusiness;

import data_bases.business.DataBaseBusiness;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Chucho
 */
public class BackupBusiness {
    
    public String doBackUp(String user,String password,String port,String path){
             
        return new BackupDAO.BackupDAO().BackupAllDatabases(user, Integer.parseInt(port),password, path);
    }

    public List<String> getDumps() throws SQLException {
        List<String> dumps = new ArrayList();
            ResultSet tablesSet = new BackupDAO.BackupDAO().getDumps();
            while(tablesSet.next()){
                dumps.add(tablesSet.getString(1));
            }
        return dumps;
    }
}
